package com.alipay.config;

import java.io.FileWriter;
import java.io.IOException;

/**
 * @author xn
 * @date 2023/5/3 9:54
 */
public class AlipayConfig {
    //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000120608453";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCUmWiDYjh7LaSPuTAuO6aqSX9+yGvIPYtZnfXkbR+yYlDVNHydY27JnBmiq9tOYcbDm7NBG3UyeNaHXawYt1Mu2lbaFt+6nY3m9p9DmUePvMuTOSVpNTDKcx0lf8tTygvu1d4FVFHIWXr3Hz9nL5mKpiCEQPp4VMlKb2Y5LyrK3/rDZZXEPaw9HcUDQdSWtE6tus/R5mkukt87ccY10BwuKNLrbnNQC8ddSx6hHAwwV6U6zN+aNrLU6yItyHLP4AmfnOVdFs7LqjY21XYpuwrI1ArtRROuaPz00K22HzxQ4pHyXIC8G2Gth/9vkP91ucPGQ7UiPTbvav8RtfEU8OWFAgMBAAECggEAJwwMp4F2v/9lX5LU80EfcV2wz9rQX6S0ak8UnvqBurkU7oFFQYIwSW/oWJN6JCWTOjE+sBwL9sBD9vwJTdFWXVhoPBSIo5vk/szNWtD7OeztPXlluDiO4pPPE9x5zEGqUw8FsTbP6qqAolEmsvGSEhnHL5l3d4kn/5Q4M0yOnRJHi+Uo5ngv7Ojyf97HlIlzKSAS0FoIVEuZXhM22PGFn/xXskdPGvGN/u3H3jDLKrCDCqddhVIa3ewS3NICGLU9kEySzNo3e+5MxHERxclbJ4FULpkgm3ekKqpIn+lapZvY5lIAnc7+wzLoDkxCT6vS+S06wF9s60DUS6ghJkhinQKBgQDsHz/7RQYgwSxKBMUaHjH41f/QIAnvwL5GSxVTNiiAwTfJrM6g1kyGy2kdtzDxXCxT89qKg4BjEOp/BbMDddkorWaSL6GBg/poNynrYbcXKcgCtbZgU7eVkM41EkQgHFLzZ4xgEN7BMs1rCCC3kcFg8EM7pKyJbB2uX3pKS7d5swKBgQChG+xUWhENUZA9GLiGoTm4tH7eVIH6O/y9ThCmnAzGFQq6geBGCWm7Q1nxKBso7dT7dKrEVRvH+6zIqfsjlgi/ao/UO+/g3PwhBtpC7FwexzEU7ZyJkruElQPGbb7bd1/ZQj2g24amIBz8alj6OAxEQehz78og/lF/yHr/IEEX5wKBgQCZ6kTqpbO45jLYjQNuYwBwFA8Mu9W+UwW1DHx6IXOFem3DKMIIVajMtQtwM1nT+yFqGCr833txGDXDVxO5zbggq+eQozvEESPJiyvoI2oVz0ZxfcHESM4C0MGaFq4RwGTSBU2b0WNizJraihHJl1lWt0ccOdu+OJugbtxoUbLnwQKBgF1sx9sSb5j9l1sWnsrTa5mEcZ2T+9uUNbfBMT6sd2vWf+YvslJq2vlQ0TNbQoS1hjBbMzuu7vFFLKkgiRXVxzTZIpa8Oxp2i27Lfn4YekMO15N/Rqswf7UehJXoxiiWTOq70ukY5DgpnyVwtjBDmDlsztOMVfZUBAbJxylzFsw5AoGBAMXOMURu8BXiVS6xsF9LuMKYvsFSPdieRet7KUaZfSgW5XRYn37JcoqVd/YcVSqhCLmdkRbyH5JeAn07ZWkszzP70Yg31mf7yDzEn9mMccQkELJvU8gUeYAqrXE+yNsM9puydA+ML4bzofvnqeOigeGAbXf4M+/wFZgDVoR3LQI5";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAupxUCKNC2BoynIzVSdlJSOSlF2FfRRDv0T54eypY2O4G3IAndKtN40RaVQRvFH8Ppy4NF2uPr3MH2A3Q6qS0URn63005955B2Opj6srUA7AgoWfe6iXO3WjtiQphmlc9EVmQQxCgvKomXc7cu+L2d4qqtayrkROvbomEwKcXAkKUojsFp8erdXPCCldwbI9SAM5K5Mmyai6D5PLf8HgsW09J0iWD8+FhROHkWYLXSZXHsxowGz1fC3NZD75NAYhwnwiR/RF6BhFZROu72QUmnBDEKv4WN6Ba/ssveeGFwqfF2htTsmCYz4OLdgKAuQ4wUSWp87RI+dL2X+jm8Ui1EwIDAQAB";
    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://alipaytest.free.svipss.top/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://alipaytest.free.svipss.top/alipay.trade.page.pay-JAVA-UTF-8/return_url.jsp";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 日志路径
    public static String log_path = "C:\\Users\\23537\\Desktop\\AlipaySource";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}



/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */


